8e0036b88494eec45a570694e8a19d645eb6b7b9,server/sonar-server/src/main/java/org/sonar/server/computation/SynchronizeProjectPermissionsStep.java,SynchronizeProjectPermissionsStep,synchronizeProjectPermissionsIfNotFound,#DbSession#String#,48

Before Change


    if (index.get(IssueAuthorizationIndex.class).getNullableByKey(projectKey) == null) {
      // TODO Remove this db call by inserting the project uuid in the report
      AuthorizedComponentDto project = dbClient.componentDao().getAuthorizedComponentByKey(projectKey, session);
      String uuid = project.uuid();
      if (uuid == null) {
        throw new IllegalArgumentException(String.format("No uuid for project %s", project));
      }

After Change


    if (index.get(IssueAuthorizationIndex.class).getNullableByKey(projectKey) == null) {
      // TODO Remove this db call by inserting the project uuid in the report
      AuthorizedComponentDto project = dbClient.componentDao().getAuthorizedComponentByKey(projectKey, session);
      permissionService.synchronizePermissions(session, project.uuid());
      session.commit();
    }
  }